Optimal. Leaf size=274 \[ -\frac {b B n (c+d x)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{2 (a+b x)^2 (b c-a d)^2}+\frac {2 B d n (c+d x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{(a+b x) (b c-a d)^2}-\frac {b (c+d x)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{2 (a+b x)^2 (b c-a d)^2}+\frac {d (c+d x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{(a+b x) (b c-a d)^2}-\frac {b B^2 n^2 (c+d x)^2}{4 (a+b x)^2 (b c-a d)^2}+\frac {2 B^2 d n^2 (c+d x)}{(a+b x) (b c-a d)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.42, antiderivative size = 411, normalized size of antiderivative = 1.50, number of steps used = 12, number of rules used = 8, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.242, Rules used = {6742, 2492, 44, 2491, 2490, 32, 2509, 37} \[ -\frac {A^2}{2 b (a+b x)^2}+\frac {A B d^2 n \log (a+b x)}{b (b c-a d)^2}-\frac {A B d^2 n \log (c+d x)}{b (b c-a d)^2}-\frac {A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b (a+b x)^2}+\frac {A B d n}{b (a+b x) (b c-a d)}-\frac {A B n}{2 b (a+b x)^2}-\frac {b B^2 (c+d x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (a+b x)^2 (b c-a d)^2}+\frac {B^2 d (c+d x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (b c-a d)^2}-\frac {b B^2 n (c+d x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (a+b x)^2 (b c-a d)^2}+\frac {2 B^2 d n (c+d x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x) (b c-a d)^2}-\frac {b B^2 n^2 (c+d x)^2}{4 (a+b x)^2 (b c-a d)^2}+\frac {2 B^2 d n^2}{b (a+b x) (b c-a d)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 32
Rule 37
Rule 44
Rule 2490
Rule 2491
Rule 2492
Rule 2509
Rule 6742
Rubi steps
\begin {align*} \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{(a+b x)^3} \, dx &=\int \left (\frac {A^2}{(a+b x)^3}+\frac {2 A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^3}+\frac {B^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^3}\right ) \, dx\\ &=-\frac {A^2}{2 b (a+b x)^2}+(2 A B) \int \frac {\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^3} \, dx+B^2 \int \frac {\log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^3} \, dx\\ &=-\frac {A^2}{2 b (a+b x)^2}-\frac {A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b (a+b x)^2}+\frac {\left (b B^2\right ) \int \frac {(c+d x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^3} \, dx}{b c-a d}-\frac {\left (B^2 d\right ) \int \frac {\log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^2} \, dx}{b c-a d}+\frac {(A B (b c-a d) n) \int \frac {1}{(a+b x)^3 (c+d x)} \, dx}{b}\\ &=-\frac {A^2}{2 b (a+b x)^2}-\frac {A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b (a+b x)^2}+\frac {B^2 d (c+d x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(b c-a d)^2 (a+b x)}-\frac {b B^2 (c+d x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (b c-a d)^2 (a+b x)^2}+\frac {\left (b B^2 n\right ) \int \frac {(c+d x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^3} \, dx}{b c-a d}-\frac {\left (2 B^2 d n\right ) \int \frac {\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(a+b x)^2} \, dx}{b c-a d}+\frac {(A B (b c-a d) n) \int \left (\frac {b}{(b c-a d) (a+b x)^3}-\frac {b d}{(b c-a d)^2 (a+b x)^2}+\frac {b d^2}{(b c-a d)^3 (a+b x)}-\frac {d^3}{(b c-a d)^3 (c+d x)}\right ) \, dx}{b}\\ &=-\frac {A^2}{2 b (a+b x)^2}-\frac {A B n}{2 b (a+b x)^2}+\frac {A B d n}{b (b c-a d) (a+b x)}+\frac {A B d^2 n \log (a+b x)}{b (b c-a d)^2}-\frac {A B d^2 n \log (c+d x)}{b (b c-a d)^2}-\frac {A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b (a+b x)^2}+\frac {2 B^2 d n (c+d x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(b c-a d)^2 (a+b x)}-\frac {b B^2 n (c+d x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (b c-a d)^2 (a+b x)^2}+\frac {B^2 d (c+d x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(b c-a d)^2 (a+b x)}-\frac {b B^2 (c+d x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (b c-a d)^2 (a+b x)^2}+\frac {\left (b B^2 n^2\right ) \int \frac {c+d x}{(a+b x)^3} \, dx}{2 (b c-a d)}-\frac {\left (2 B^2 d n^2\right ) \int \frac {1}{(a+b x)^2} \, dx}{b c-a d}\\ &=-\frac {A^2}{2 b (a+b x)^2}-\frac {A B n}{2 b (a+b x)^2}+\frac {A B d n}{b (b c-a d) (a+b x)}+\frac {2 B^2 d n^2}{b (b c-a d) (a+b x)}-\frac {b B^2 n^2 (c+d x)^2}{4 (b c-a d)^2 (a+b x)^2}+\frac {A B d^2 n \log (a+b x)}{b (b c-a d)^2}-\frac {A B d^2 n \log (c+d x)}{b (b c-a d)^2}-\frac {A B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{b (a+b x)^2}+\frac {2 B^2 d n (c+d x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(b c-a d)^2 (a+b x)}-\frac {b B^2 n (c+d x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (b c-a d)^2 (a+b x)^2}+\frac {B^2 d (c+d x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{(b c-a d)^2 (a+b x)}-\frac {b B^2 (c+d x)^2 \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )}{2 (b c-a d)^2 (a+b x)^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.52, size = 332, normalized size = 1.21 \[ -\frac {(b c-a d) \left (2 A^2 (b c-a d)+2 B (2 A (b c-a d)+B n (-3 a d+b c-2 b d x)) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+2 A B n (-3 a d+b c-2 b d x)+2 B^2 (b c-a d) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )+B^2 n^2 (-7 a d+b c-6 b d x)\right )+2 B d^2 n (a+b x)^2 \log (c+d x) \left (2 B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+2 A+3 B n\right )-2 B d^2 n (a+b x)^2 \log (a+b x) \left (2 B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+2 A+2 B n \log (c+d x)+3 B n\right )+2 B^2 d^2 n^2 (a+b x)^2 \log ^2(c+d x)+2 B^2 d^2 n^2 (a+b x)^2 \log ^2(a+b x)}{4 b (a+b x)^2 (b c-a d)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.77, size = 919, normalized size = 3.35 \[ -\frac {2 \, A^{2} b^{2} c^{2} - 4 \, A^{2} a b c d + 2 \, A^{2} a^{2} d^{2} + {\left (B^{2} b^{2} c^{2} - 8 \, B^{2} a b c d + 7 \, B^{2} a^{2} d^{2}\right )} n^{2} - 2 \, {\left (B^{2} b^{2} d^{2} n^{2} x^{2} + 2 \, B^{2} a b d^{2} n^{2} x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n^{2}\right )} \log \left (b x + a\right )^{2} - 2 \, {\left (B^{2} b^{2} d^{2} n^{2} x^{2} + 2 \, B^{2} a b d^{2} n^{2} x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n^{2}\right )} \log \left (d x + c\right )^{2} + 2 \, {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d + B^{2} a^{2} d^{2}\right )} \log \relax (e)^{2} + 2 \, {\left (A B b^{2} c^{2} - 4 \, A B a b c d + 3 \, A B a^{2} d^{2}\right )} n - 2 \, {\left (3 \, {\left (B^{2} b^{2} c d - B^{2} a b d^{2}\right )} n^{2} + 2 \, {\left (A B b^{2} c d - A B a b d^{2}\right )} n\right )} x + 2 \, {\left ({\left (B^{2} b^{2} c^{2} - 4 \, B^{2} a b c d\right )} n^{2} - {\left (3 \, B^{2} b^{2} d^{2} n^{2} + 2 \, A B b^{2} d^{2} n\right )} x^{2} + 2 \, {\left (A B b^{2} c^{2} - 2 \, A B a b c d\right )} n - 2 \, {\left (2 \, A B a b d^{2} n + {\left (B^{2} b^{2} c d + 2 \, B^{2} a b d^{2}\right )} n^{2}\right )} x - 2 \, {\left (B^{2} b^{2} d^{2} n x^{2} + 2 \, B^{2} a b d^{2} n x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n\right )} \log \relax (e)\right )} \log \left (b x + a\right ) - 2 \, {\left ({\left (B^{2} b^{2} c^{2} - 4 \, B^{2} a b c d\right )} n^{2} - {\left (3 \, B^{2} b^{2} d^{2} n^{2} + 2 \, A B b^{2} d^{2} n\right )} x^{2} + 2 \, {\left (A B b^{2} c^{2} - 2 \, A B a b c d\right )} n - 2 \, {\left (2 \, A B a b d^{2} n + {\left (B^{2} b^{2} c d + 2 \, B^{2} a b d^{2}\right )} n^{2}\right )} x - 2 \, {\left (B^{2} b^{2} d^{2} n^{2} x^{2} + 2 \, B^{2} a b d^{2} n^{2} x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n^{2}\right )} \log \left (b x + a\right ) - 2 \, {\left (B^{2} b^{2} d^{2} n x^{2} + 2 \, B^{2} a b d^{2} n x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n\right )} \log \relax (e)\right )} \log \left (d x + c\right ) + 2 \, {\left (2 \, A B b^{2} c^{2} - 4 \, A B a b c d + 2 \, A B a^{2} d^{2} - 2 \, {\left (B^{2} b^{2} c d - B^{2} a b d^{2}\right )} n x + {\left (B^{2} b^{2} c^{2} - 4 \, B^{2} a b c d + 3 \, B^{2} a^{2} d^{2}\right )} n\right )} \log \relax (e)}{4 \, {\left (a^{2} b^{3} c^{2} - 2 \, a^{3} b^{2} c d + a^{4} b d^{2} + {\left (b^{5} c^{2} - 2 \, a b^{4} c d + a^{2} b^{3} d^{2}\right )} x^{2} + 2 \, {\left (a b^{4} c^{2} - 2 \, a^{2} b^{3} c d + a^{3} b^{2} d^{2}\right )} x\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2}}{{\left (b x + a\right )}^{3}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 3.36, size = 17300, normalized size = 63.14 \[ \text {output too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.85, size = 899, normalized size = 3.28 \[ \frac {1}{4} \, B^{2} {\left (\frac {2 \, {\left (\frac {2 \, d^{2} e n \log \left (b x + a\right )}{b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}} - \frac {2 \, d^{2} e n \log \left (d x + c\right )}{b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}} + \frac {2 \, b d e n x - b c e n + 3 \, a d e n}{a^{2} b^{2} c - a^{3} b d + {\left (b^{4} c - a b^{3} d\right )} x^{2} + 2 \, {\left (a b^{3} c - a^{2} b^{2} d\right )} x}\right )} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )}{e} - \frac {b^{2} c^{2} e^{2} n^{2} - 8 \, a b c d e^{2} n^{2} + 7 \, a^{2} d^{2} e^{2} n^{2} + 2 \, {\left (b^{2} d^{2} e^{2} n^{2} x^{2} + 2 \, a b d^{2} e^{2} n^{2} x + a^{2} d^{2} e^{2} n^{2}\right )} \log \left (b x + a\right )^{2} + 2 \, {\left (b^{2} d^{2} e^{2} n^{2} x^{2} + 2 \, a b d^{2} e^{2} n^{2} x + a^{2} d^{2} e^{2} n^{2}\right )} \log \left (d x + c\right )^{2} - 6 \, {\left (b^{2} c d e^{2} n^{2} - a b d^{2} e^{2} n^{2}\right )} x - 6 \, {\left (b^{2} d^{2} e^{2} n^{2} x^{2} + 2 \, a b d^{2} e^{2} n^{2} x + a^{2} d^{2} e^{2} n^{2}\right )} \log \left (b x + a\right ) + 2 \, {\left (3 \, b^{2} d^{2} e^{2} n^{2} x^{2} + 6 \, a b d^{2} e^{2} n^{2} x + 3 \, a^{2} d^{2} e^{2} n^{2} - 2 \, {\left (b^{2} d^{2} e^{2} n^{2} x^{2} + 2 \, a b d^{2} e^{2} n^{2} x + a^{2} d^{2} e^{2} n^{2}\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )}{{\left (a^{2} b^{3} c^{2} - 2 \, a^{3} b^{2} c d + a^{4} b d^{2} + {\left (b^{5} c^{2} - 2 \, a b^{4} c d + a^{2} b^{3} d^{2}\right )} x^{2} + 2 \, {\left (a b^{4} c^{2} - 2 \, a^{2} b^{3} c d + a^{3} b^{2} d^{2}\right )} x\right )} e^{2}}\right )} - \frac {B^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )^{2}}{2 \, {\left (b^{3} x^{2} + 2 \, a b^{2} x + a^{2} b\right )}} + \frac {{\left (\frac {2 \, d^{2} e n \log \left (b x + a\right )}{b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}} - \frac {2 \, d^{2} e n \log \left (d x + c\right )}{b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}} + \frac {2 \, b d e n x - b c e n + 3 \, a d e n}{a^{2} b^{2} c - a^{3} b d + {\left (b^{4} c - a b^{3} d\right )} x^{2} + 2 \, {\left (a b^{3} c - a^{2} b^{2} d\right )} x}\right )} A B}{2 \, e} - \frac {A B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )}{b^{3} x^{2} + 2 \, a b^{2} x + a^{2} b} - \frac {A^{2}}{2 \, {\left (b^{3} x^{2} + 2 \, a b^{2} x + a^{2} b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.32, size = 444, normalized size = 1.62 \[ -{\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )}^2\,\left (\frac {B^2}{2\,b\,\left (a^2+2\,a\,b\,x+b^2\,x^2\right )}-\frac {B^2\,d^2}{2\,b\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )-\frac {\frac {2\,A^2\,a\,d-2\,A^2\,b\,c+7\,B^2\,a\,d\,n^2-B^2\,b\,c\,n^2+6\,A\,B\,a\,d\,n-2\,A\,B\,b\,c\,n}{2\,\left (a\,d-b\,c\right )}+\frac {d\,x\,\left (3\,b\,B^2\,n^2+2\,A\,b\,B\,n\right )}{a\,d-b\,c}}{2\,a^2\,b+4\,a\,b^2\,x+2\,b^3\,x^2}-\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (\frac {A\,B}{a^2\,b+2\,a\,b^2\,x+b^3\,x^2}+\frac {B^2\,d^2\,\left (\frac {b\,n\,\left (a\,d-b\,c\right )\,\left (2\,a\,d-b\,c\right )}{2\,d^2}+\frac {b^2\,n\,x\,\left (a\,d-b\,c\right )}{d}+\frac {a\,b\,n\,\left (a\,d-b\,c\right )}{2\,d}\right )}{b\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )\,\left (a^2\,b+2\,a\,b^2\,x+b^3\,x^2\right )}\right )-\frac {B\,d^2\,n\,\mathrm {atan}\left (\frac {\left (2\,b\,d\,x-\frac {2\,b^3\,c^2-2\,a^2\,b\,d^2}{2\,b\,\left (a\,d-b\,c\right )}\right )\,1{}\mathrm {i}}{a\,d-b\,c}\right )\,\left (2\,A+3\,B\,n\right )\,1{}\mathrm {i}}{b\,{\left (a\,d-b\,c\right )}^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________